package com.umeox.watch.moto.dataservice.db.dao;

import androidx.room.Dao;
import androidx.room.Insert;
import androidx.room.OnConflictStrategy;
import androidx.room.Query;

import com.umeox.watch.moto.dataservice.db.model.QuranLearn;

import java.util.List;

/**
 * Created by Rambo 2021/9/18
 * Describe:
 */
@Dao
public interface QuranLearnDao {

    @Query("SELECT * FROM quran_learn")
    List<QuranLearn> queryAll();

    @Insert(onConflict = OnConflictStrategy.REPLACE)
    long save(QuranLearn quranLearn);

    @Insert(onConflict = OnConflictStrategy.REPLACE)
    void save(List<QuranLearn> quranLearns);

    @Query("DELETE FROM quran_learn")
    int deleteAll();

    @Query("SELECT * FROM quran_learn WHERE id = :id")
    QuranLearn queryById(int id);
}
